﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.MesMsgQueues
{
    public class MesMsgQueueConfig : IEntityTypeConfiguration<MesMsgQueue>
    {
        public void Configure(EntityTypeBuilder<MesMsgQueue> builder)
        {
            builder.HasComment("Mes消息队列");
            builder.Property(x => x.Sender).IsRequired().HasComment("发送方");
            builder.Property(x => x.TransactionId).IsRequired().HasMaxLength(45).HasComment("时间戳");
            builder.Property(x => x.Content).IsRequired().HasColumnType("longtext").HasComment("数据内容");
            builder.Property(x => x.Return).IsRequired().HasColumnType("longtext").HasComment("返回的数据");
            builder.Property(x => x.EventName).HasDefaultValue("").HasMaxLength(100).HasComment("主题");
            builder.Property(x => x.Status).IsRequired().HasComment("消息状态");
            builder.Property(x => x.BusinessType).IsRequired(false).HasMaxLength(50).HasComment("业务类型");
            builder.Property(x => x.RequestType).IsRequired().HasComment("请求类型");
        }
    }
}
